let success = function (that, message) {
  that.$message({
    message: message,
    type: 'success',
    duration: 2000
  })
}
let warning = function (that, message) {
  that.$message({
    message: message,
    type: 'success',
    duration: 2000
  })
}
let error = function (that, message) {
  that.$message({
    message: message,
    type: 'error',
    duration: 3000
  })
}
let notifySuccess = function (that, message) {
  that.$notify({
    title: '成功',
    message: message,
    type: 'success'
  })
}
let notifyWarning = function (that, message) {
  that.$notify({
    title: '警告',
    message: message,
    type: 'warning'
  })
}
let notifyInfo = function (that, message) {
  that.$notify.info({
    title: '消息',
    message: message
  })
}

let notifyError = function (that, message) {
  that.$notify.error({
    title: '错误',
    message: message
  })
}

let confirmWarning = function (that, message, ok) {
  that.$confirm(message, '提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning'
  }).then(() => {
    that.$message({
      type: 'success',
      message: '删除成功!'
    })
  }).catch(() => {
    that.$message({
      type: 'info',
      message: '已取消删除'
    })
  })
}

export default {
  success,
  warning,
  error,
  notifySuccess,
  notifyWarning,
  notifyInfo,
  notifyError,
  confirmWarning
}
